home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / SLIP / InterTIA Folder / DialTIA next >
Encoding:
Text File  |  1994-09-02  |  2.1 KB  |  98 lines  |  [TEXT/EMAC]

  1. ! InterSLIP dial script for Hayes compatible modems and The Internet Adapter
  2.  
  3. ! Original script by Fred Morris
  4. ! Modifications by Adam C. Engst, Paul Ediger
  5. ! Modified for The Internet Adapter (TIA) by Bill Arnett
  6. !   other users may have to modify the lines marked with "<-------- "
  7.  
  8. @originate
  9. ! Initialize modem from string in InterSLIP configuration
  10. note "Initializing modem"
  11. write "^4\13"
  12. pause 10
  13. ! Set speaker mode
  14. write "ATM^2\13"
  15. pause 10
  16. SetTries 0
  17.  
  18. @label 8
  19. ! Dial modem from number and tone/pulse option in InterSLIP configuration
  20. note "Dialing ^1"
  21. write "ATd^3^1\13"
  22. pause 30                ! just so he can see the phone #
  23.  
  24. ! Check only for BUSY or CONNECT
  25. matchstr 1 10 "BUSY"
  26. matchstr 2 20 "CONNECT"
  27. note "Waiting for CONNECT"
  28. matchread 500
  29.  
  30. @label 10
  31. ! got BUSY or no response
  32. IncTries
  33. IfTries 10 15
  34.  
  35. ! hang up and reinitialize modem from string in InterSLIP configuration
  36. note "Reinitializing modem"
  37. write "+++"
  38. pause 60
  39. write "ATh\13"
  40. write "^4\13"
  41. jump 8
  42.  
  43. @label 15
  44. ! ask the user if he wants to continue dialing
  45. ask 0 "enter anything to stop"
  46. SetTries 0
  47. ifstr 1 8 "^*^1"
  48.  
  49. ! he wants to stop
  50. SetTries 123        ! indicate that dialing failed
  51. exit -1
  52.  
  53. @label 20
  54. ! got CONNECT, indicate success and proceed to the Gateway script
  55. exit 0
  56.  
  57.  
  58. @hangup
  59. ! check whether user manually clicked the Disconnect button or dialing failed
  60. IfTries 123 99
  61.  
  62. pause 1
  63. note "Killing TIA"
  64. write "\03\03\03"            ! <-------- kill character
  65. pause 21
  66. write "\03\03"                ! <-------- kill character
  67. matchclr
  68. matchstr 1 30 "% "            ! <-------- shell prompt
  69. matchread 30
  70. ! if we fail to kill TIA, just drop the line anyway
  71. jump 50
  72.  
  73. @label 30
  74. ! issue logout command to logout normally
  75. note "Logging out"
  76. write "logout\13"            ! <-------- logout command
  77. matchclr
  78. ! the modem should notice that the host dropped the line
  79. matchstr 1 98 "NO CARRIER"
  80. matchread 400
  81. ! if the host doesn't drop the line, we hang up locally
  82.  
  83. @label 50
  84. ! Hang up the modem
  85. note "Hanging up modem"
  86. write "+++"
  87. pause 60
  88. write "ATh\13"
  89.  
  90. @label 98
  91. ! Reinitialize the modem from string in InterSLIP configuration
  92. write "^4\13"
  93.  
  94. @label 99
  95. ! we're outta here!
  96. note "Off"
  97. exit 0
  98.